package com.rem.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author remembrance
 * @version 1.0
 * @date 2021/11/16 9:19
 */
@Slf4j
@Controller
public class FormController {

    @GetMapping("/form_layouts")
    public String form_layouts(){
        return "form/form_layouts";
    }

    @PostMapping("/upload")
    @ResponseBody
    public String upload(@RequestParam("email")String email,
                         @RequestParam("password")String password,
                         @RequestPart(value = "single_file",required = false)MultipartFile file,
                         @RequestPart(value = "multiple_files",required = false)MultipartFile[] file2){

        log.info("上传的文件信息");
        log.info("email={},password={},file={},file2={}",
                email,password,file.getSize(),file2.length);
        return "success";
    }
}
